<?php 
	session_start();
    require_once('../cfg/config.php');
	try {
		$cnx = new PDO('mysql:host='.$PARAM_hote.';port='.$PARAM_port.';dbname='.$PARAM_nom_db, $PARAM_utilisateur, $PARAM_mdp);
	} catch(Exception $e) {
		echo 'Erreur : '.$e->getMessage().'<br />';
		echo 'N° : '.$e->getCode();
	}
	// ON RECUPERE LA LISTE DES MEMBRES
	$servers = $cnx->query("SELECT * FROM server ORDER BY srvnom DESC");
	$servers->setFetchMode(PDO::FETCH_OBJ);
?>
<table width="50%" border="0" cellpadding="0" cellspacing="0" class="table">
              <thead><tr class="table_header">
                <th width="30" height="25" align="left" style="padding-left:5px;">Opt.</th>
                <th align="left">Nom</th>
                <th align="left">Adresse IP</th>
                <th align="left">Port</th>
                <th align="left">Protocole</th>
              </tr></thead>
<?php
	while($s = $servers->fetch()) {
?>	
               <tr>
                <td align="center" style="padding:5px;"><img src="img/user-delete.png" onClick="javascript:deleteServer(<?php echo $s->id ?>)" width="16" height="16" style="cursor:pointer;" align="absmiddle" border="0"></td>
                <td onClick="document.location='serveurs-modify.php?id=<?php echo $s->id ?>'" style="cursor:pointer;"><?php echo htmlentities($s->srvnom); ?></td>
                <td onClick="document.location='serveurs-modify.php?id=<?php echo $s->id ?>'" style="cursor:pointer;"><?php echo htmlentities($s->srvip); ?></td>
                <td onClick="document.location='serveurs-modify.php?id=<?php echo $s->id ?>'" style="cursor:pointer;"><?php echo $s->srvpor; ?></td>
                <td onClick="document.location='serveurs-modify.php?id=<?php echo $s->id ?>'" style="cursor:pointer;"><?php echo $s->srvptc;?></td>
              </tr>
<?php
	}
	$servers->closeCursor();
?>
            </table>